package main

import (
	"github.com/sirupsen/logrus"
	"linproxy/server"
	"os"
	"os/signal"
	"syscall"
)

func main() {

	ip := "127.0.0.1"
	port := 8080

	//创建服务器
	srv := server.New(1, ip, port, "tcp")


	if err := srv.Start(); err != nil {
		logrus.Fatalf("start server: %v", err)
	}

	logrus.Infof("server started on %s:%d", ip, port)

	sigCh := make(chan os.Signal, 1)
	signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)
	<-sigCh
	logrus.Info("signal received, stopping...")
	srv.Stop()
}
